﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Lidgren.Network;

using TradeSea;

namespace TradeSeaShared
{
    //[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
    //public class PacketAttribute : Attribute
    //{
    //    public int ID;

    //    // This is a positional argument
    //    public PacketAttribute(int id)
    //    {
    //        this.ID = id;
    //    }
    //}

    public class ClientPackets
    {
        [Packet(1)]
        public static void ChatMessage(NetIncomingMessage msg, INet client)
        {
            Singiltons.Log("Chat", msg.ReadString());
        }

        [Packet(2)]
        public static void BoatUpdates(NetIncomingMessage msg, INet client)
        {
            int count = msg.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                ClientBoats.UpdateBoat(msg.ReadFloat(), msg.ReadFloat(), msg.ReadInt32());
            }
        }
    }
}
